﻿/**
 * ...
 * @author George Mavchun
 */

package gui.hug.priv;

import gui.hug.HUGColors;
import flash.display.Shape;

class HUGBorder extends Shape
{
	public static inline var BASIC : Int = 1;
	public static inline var COMPLEX : Int = 2;

	public function new(width : Float, height : Float, ?type : Int) {
		super();
		switch (type) {
			case COMPLEX : drawComplex(width, height);
			default : drawBasic(width, height);
		}
	}
	
	private function drawBasic(width : Float, height : Float) {
		graphics.beginFill(HUGColors.VK_BORDER_OUTER);
        graphics.drawRect(0, 0, width, height);
        graphics.endFill();
		
		graphics.beginFill(HUGColors.VK_BORDER_INNER);
        graphics.drawRect(1, 1, width - 2, height - 2);
        graphics.endFill();
		
		graphics.beginFill(HUGColors.WHITE);
        graphics.drawRect(11, 11, width - 22, height - 22);
        graphics.endFill();
	}
	
	private function drawComplex(width : Float, height : Float) {
		graphics.beginFill(HUGColors.VK_BORDER_INNER);
        graphics.drawRect(0, 0, width, height);
        graphics.endFill();
		
		graphics.beginFill(HUGColors.VK_BORDER_OUTER);
        graphics.drawRect(10, 10, width - 20, height - 20);
        graphics.endFill();
		
		graphics.beginFill(HUGColors.WHITE);
        graphics.drawRect(11, 11, width - 22, height - 22);
        graphics.endFill();
	}
	
}